package com.springmvc.demo.service.impl;


import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.springmvc.demo.mapper.MenuMapper;
import com.springmvc.demo.model.RoleMenu;
import com.springmvc.demo.service.MenuService;

@Service
public class MenuServiceImpl implements MenuService{
	
	@Autowired
	MenuMapper menuMapper;
	
	@Override
	public List<RoleMenu> loadMenu(String roleid) {
		// TODO Auto-generated method stub
		Map<String,Object> map=new HashMap<>();
		map.put("roleid", roleid);
		return menuMapper.selectByMap(map);
	}

	@Override
	public String addMenu(RoleMenu roleMenu) {
		// TODO Auto-generated method stub
		
		int i=menuMapper.insert(roleMenu);
		if(i>0)
			return "添加成功";
		else
			return "添加失败";
					
	}

	@Override
	public String deleteMenu(RoleMenu roleMenu) {
		// TODO Auto-generated method stub
		return null;
	}

}
